package com.example.demo.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.example.demo.model.PageResult;
import com.example.demo.model.User;
import com.example.demo.model.UserQuery;
import com.example.demo.model.UserVO;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: lishuo
 * Date: 2024-05-04
 * Time: 9:44
 */
public interface IUserService extends IService<User> {
    /**
     * 根据用户 id 扣减余额
     * @param id
     * @param money
     */
    void deductBalanceById(Long id, Integer money);

    /**
     * 复杂条件查询用户
     * @param name
     * @param status
     * @param minBalance
     * @param maxBalance
     */
    List<User> queryUsers(String name, Integer status, Integer minBalance, Integer maxBalance);

    /**
     * 根据用户id集合查询用户以及地址列表
     * @param ids
     * @return
     */
    List<UserVO> queryUserAndAddressesByIds(List<Long> ids);

    /**
     * 分页条件查询
     * @param userQuery
     * @return
     */
    PageResult<UserVO> pageQueryUser(UserQuery userQuery);
}
